# from selenium.webdriver import Chrome
from time import sleep

from selenium import webdriver

from selenium_po_practice.Pages.base_page import BasePage


class MemberAddingPage(BasePage):

    def add_member(self):
        """
        添加成员操作
        :return:通讯录页面实例对象
        """
        # 导入操作移动到方法内部，解决循环导入问题
        from selenium_po_practice.Pages.contact_page import ContactPage
        sleep(5)
        self.driver.find_element_by_xpath('//*[@id="username"]').send_keys('赵峰')
        self.driver.find_element_by_xpath('//*[@id="memberAdd_acctid"]').send_keys('zf')
        self.driver.find_element_by_xpath('//*[@id="memberAdd_phone"]').send_keys('18905329850')
        self.driver.find_element_by_css_selector('.js_btn_save').click()
        return ContactPage(self.driver)

if __name__ == '__main__':
    ad = MemberAddingPage()
    ad.add_member()